/**
 * Created by zhangb on 2015/8/26.
 */
var arr = ['red','white','blue'];
//if(arr instanceof Array)
if(Array.isArray(arr))
{
    alert(typeof arr.toString());
    alert(typeof arr.valueOf());
    alert(typeof arr);

}else{
    function displayInfo(args)
    {
        var output ="";
        if(typeof args.name == "string")
        {
            output += "Name:" + args.name + "\n";
        }
        if(typeof args.age == "number")
        {
            output += "Age:" + args.age + "\n";
        }
        alert(output);
    }

    displayInfo({
        name:"reference type",
        age:30
    });
    displayInfo({age:20});
}

